Rem	VBScript For probing In the x direction

If GetOemLed (825) <> 0 Then 		'Check to see if the probe is already grounded or faulty
	Code "(Probe plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Else
	Code "G4 P2"			'Pause 1 second to give time to position probe plate

	CurrentFeed = GetOemDRO(818) 	'Get the current feedrate to return to later
	Code "F10"

Rem	Probe left

	XNew = GetDro(0) + 3		'probe to current position + 3 inches
	Code "G31 X" &XNew
	While IsMoving()		'wait for prob move to complete
	Wend
	XNew = GetVar(2000)		'read the touch point

Rem	move back to the hit point incase there was an overshoot

	Code "G91 G0 Z.500"
	Code "G90 G0 X" &XNew
        Code "G91 X.100"

	While IsMoving ()
	Wend
        Call SetDro (0,0.000)
        Code "G4 P0.25"

	Code "F" &CurrentFeed 		'restore original feed rate
End If